package cn.lijigou.shopping;

import cn.lijigou.shopping.service.MSystem;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.provider.Browser;
import android.text.method.LinkMovementMethod;
import android.view.View;
import android.view.Window;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;

public class AboutUsActivity extends MActivity implements OnClickListener{
	
	private TextView mTitle_btn_right = null;
	private TextView mTitle_btn_left = null;
	private LinearLayout titleLeftView = null;
	private TextView mTitle_center = null;
	private LinearLayout mPhone= null;
	
	private TextView  sina = null;
	private TextView  qq = null;
	
	
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE); // 注意顺序      
		this.setContentView(R.layout.about);
		overridePendingTransition(R.anim.push_in,R.anim.push_out);
		
		mTitle_btn_left = (TextView) findViewById(R.id.title_btn_left);
		titleLeftView = (LinearLayout) findViewById(R.id.titleLeftView);
		mTitle_btn_left.setBackgroundResource(R.drawable.title_back_normal);
		mTitle_btn_right = (TextView) findViewById(R.id.title_btn_right);
		findViewById(R.id.titleRightView).setVisibility(View.GONE);
		mTitle_btn_right.setVisibility(View.GONE);
		mTitle_center = (TextView) findViewById(R.id.text_center);
		mPhone = (LinearLayout) findViewById(R.id.phone);
		mPhone.setOnClickListener(this);
		mTitle_center.setText(R.string.about_us);
		mTitle_btn_right.setOnClickListener(this);
		titleLeftView.setOnClickListener(this);
		
		sina = (TextView)findViewById(R.id.sina);
		qq = (TextView)findViewById(R.id.qq);
		sina.setMovementMethod(LinkMovementMethod.getInstance());
		qq.setMovementMethod(LinkMovementMethod.getInstance());

	}

	
	public void onClick(View v) {
		MSystem.pv +=1;
		switch (v.getId()) {
		case R.id.titleLeftView:
			this.finish();
			break;
		case R.id.title_btn_right:
			Intent mIntent = new Intent(this, RegisterActivity.class);
			this.startActivity(mIntent);
			break;
		case R.id.phone:
			call();
			break;
		}
	}
	
	public void call() {
		Uri uri = Uri.parse("tel:"+"400-7055-700");
	    Intent intent = new Intent(Intent.ACTION_VIEW, uri);
	    intent.putExtra(Browser.EXTRA_APPLICATION_ID, this.getPackageName());
	    this.startActivity(intent);
}
}

